from cryptography.fernet import Fernet

# 请替换为你们的火山引擎后台的API Key，获取API Key的地址：https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey?apikey=%7B%7D
api_key = ""
# 请替换为你们自己搭建的知识库ID（注意，个人版也有一天1元的付费）
knowledge_service_id = ""
system_prompt = ""
model_version = "doubao-1-5-pro-32k-250115"

# 加密函数
def encrypt_message(message: str, key: bytes) -> bytes:
    f = Fernet(key)
    encrypted_data = f.encrypt(message.encode('utf-8'))
    return encrypted_data

# 解密函数
def decrypt_message(encrypted_data: bytes, key: bytes) -> str:
    f = Fernet(key)
    decrypted_data = f.decrypt(encrypted_data)
    return decrypted_data.decode('utf-8')

encrypt_key = "EVlEojKALOYR7z829Kn4rFazmpC-HoJ_ZEVQZvN08vQ=".encode("utf-8")